#include <iostream>
using namespace std;
#define ll long long
void solve()
{
    int t = 0;
    cin >> t;
    int i = 0;
    for (i = 0; i < t;i++)
    {
        int a1,a2,a3;
        int tag1 = 0,tag2 = 0,tag3 = 0;
        cin >> a1;
        cin >> a2;
        cin >> a3;
            if((a1+a2)%2 == 0)
                tag3 = 1;
            if((a1+a3)%2 == 0)
                tag2 = 1;
            if((a2+a3)%2 == 0)
                tag1 = 1;
            printf("%d %d %d\n",tag1,tag2,tag3);

    }
}
int main()
{
    solve();
    return 0;
}
